using System.Data.Entity.Migrations;

namespace Pyramid.Models.Migrations
{
	public partial class Init : DbMigration
	{
		public override void Up()
		{
			CreateTable(
			            "dbo.Accounts",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 UserId = c.String(false, 20),
				                 Password = c.String(false, 50),
				                 FullName = c.String(false, 20),
				                 Email = c.String(false, 50),
				                 Mobile = c.String(false, 20),
				                 UserType = c.Int(false),
				                 ExtInfoId = c.Int(false),
				                 ExtInfoName = c.String(maxLength: 50),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.Roles",
			            c => new
			                 {
				                 RoleId = c.Int(false, true),
				                 RoleName = c.String(maxLength: 20),
				                 Description = c.String(maxLength: 100),
				                 UserTypes = c.Int(false),
				                 FunctionCodes = c.String(),
			                 })
				.PrimaryKey(t => t.RoleId);

			CreateTable(
			            "dbo.WebObjects",
			            c => new
			                 {
				                 Id = c.String(false, 20),
				                 Name = c.String(maxLength: 20),
				                 ParentId = c.String(maxLength: 20),
				                 WebObjectType = c.Int(false),
				                 Href = c.String(maxLength: 50),
				                 Target = c.String(maxLength: 20),
				                 OrderWeight = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.Departments",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(false, 20),
				                 Description = c.String(maxLength: 100),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.StaffPositions",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.Staffs",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Code = c.String(maxLength: 20),
				                 FullName = c.String(maxLength: 20),
				                 Gender = c.Int(false),
				                 Birthday = c.DateTime(false),
				                 IdCard = c.String(maxLength: 20),
				                 Mobile = c.String(maxLength: 20),
				                 HomeAddress = c.String(maxLength: 50),
				                 PositionId = c.Int(false),
				                 BriefIntro = c.String(maxLength: 200),
				                 EntryDate = c.DateTime(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
				                 DepartmentId = c.Int(false),
				                 Status = c.Int(false),
				                 UserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Departments", t => t.DepartmentId, true)
				.ForeignKey("dbo.StaffPositions", t => t.PositionId, true)
				.Index(t => t.DepartmentId)
				.Index(t => t.PositionId);

			CreateTable(
			            "dbo.StaffSalarySetMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 StaffId = c.Int(false),
				                 EffectiveDate = c.DateTime(false),
				                 Remark = c.String(maxLength: 50),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Staffs", t => t.StaffId, true)
				.Index(t => t.StaffId);

			CreateTable(
			            "dbo.StaffSalarySetDetails",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 PartId = c.Int(false),
				                 Value = c.Decimal(false, 18, 2),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.StaffSalarySetMasters", t => t.MasterId, true)
				.ForeignKey("dbo.SalaryParts", t => t.PartId, true)
				.Index(t => t.MasterId)
				.Index(t => t.PartId);

			CreateTable(
			            "dbo.SalaryParts",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(false, 20),
				                 Code = c.String(false, 10),
				                 SalaryPartType = c.Int(false),
				                 VariableName = c.String(false, 20),
				                 DisplayFormat = c.String(),
				                 CalculateType = c.Int(false),
				                 Remark = c.String(maxLength: 50),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.AttendanceDetails",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 StaffId = c.Int(false),
				                 ActualDays = c.Int(false),
				                 MasterId = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Staffs", t => t.StaffId, true)
				.ForeignKey("dbo.AttendanceMasters", t => t.MasterId, true)
				.Index(t => t.StaffId)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.AttendanceMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Year = c.Int(false),
				                 Month = c.Int(false),
				                 ExpectedDays = c.Int(false),
				                 Status = c.Int(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.MarketZones",
			            c => new
			                 {
				                 ZoneId = c.Int(false, true),
				                 ZoneName = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.ZoneId);

			CreateTable(
			            "dbo.StaffAchievementGatherMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Year = c.Int(false),
				                 Month = c.Int(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(false, 20),
				                 Status = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.StaffAchievementGatherDetails",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 StaffId = c.Int(false),
				                 TotalAmount = c.Decimal(false, 18, 2),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Staffs", t => t.StaffId, true)
				.ForeignKey("dbo.StaffAchievementGatherMasters", t => t.MasterId, true)
				.Index(t => t.StaffId)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.PerformanceMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Year = c.Int(false),
				                 Month = c.Int(false),
				                 Status = c.Int(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.PerformanceDetails",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 StaffId = c.Int(false),
				                 Score = c.Int(false),
				                 MasterId = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Staffs", t => t.StaffId, true)
				.ForeignKey("dbo.PerformanceMasters", t => t.MasterId, true)
				.Index(t => t.StaffId)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.FinanceProjects",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(false, 20),
				                 PayerType = c.Int(false),
				                 ProjectType = c.Int(false),
				                 Remark = c.String(maxLength: 200),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.FinanceAccounts",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Account = c.String(false, 20),
				                 AccountType = c.String(false, 20),
				                 Remark = c.String(maxLength: 200),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.PayeeRecords",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 ProjectId = c.Int(false),
				                 Amount = c.Decimal(false, 18, 2),
				                 Year = c.Int(false),
				                 Month = c.Int(false),
				                 Instruction = c.String(maxLength: 200),
				                 PayerId = c.Int(false),
				                 PayerName = c.String(false, 20),
				                 PayerType = c.Int(false),
				                 ApplyUserId = c.String(false, 20),
				                 ApplyUserName = c.String(false, 20),
				                 ApplyTime = c.DateTime(false),
				                 FinanceAccountId = c.Int(false),
				                 Status = c.Int(false),
				                 VerifyId = c.Int(),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.PayeeVerifies", t => t.VerifyId)
				.ForeignKey("dbo.FinanceProjects", t => t.ProjectId, true)
				.ForeignKey("dbo.FinanceAccounts", t => t.FinanceAccountId, true)
				.Index(t => t.VerifyId)
				.Index(t => t.ProjectId)
				.Index(t => t.FinanceAccountId);

			CreateTable(
			            "dbo.PayeeVerifies",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 VerifyUserId = c.String(false, 20),
				                 VerifyTime = c.DateTime(false),
				                 FinanceNumber = c.String(false, 40),
				                 VerifyRemark = c.String(maxLength: 200),
				                 PayeeRecordId = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.CustomerCapitals",
			            c => new
			                 {
				                 CustomerId = c.Int(false),
				                 Balance = c.Decimal(false, 18, 2),
				                 RechargeTotal = c.Decimal(false, 18, 2),
				                 ConsumeTotal = c.Decimal(false, 18, 2),
			                 })
				.PrimaryKey(t => t.CustomerId);

			CreateTable(
			            "dbo.StaffSalaryMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Year = c.Int(false),
				                 Month = c.Int(false),
				                 Status = c.Int(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.StaffSalarySummaries",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 StaffId = c.Int(false),
				                 MasterId = c.Int(false),
				                 Total = c.Decimal(false, 18, 2),
				                 Status = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Staffs", t => t.StaffId, true)
				.ForeignKey("dbo.StaffSalaryMasters", t => t.MasterId, true)
				.Index(t => t.StaffId)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.StaffSalaryDetails",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 StaffId = c.Int(false),
				                 PartId = c.Int(false),
				                 Value = c.Decimal(false, 18, 2),
				                 SettingId = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.StaffSalaryMasters", t => t.MasterId, true)
				.ForeignKey("dbo.StaffSalarySetDetails", t => t.SettingId, true)
				.Index(t => t.MasterId)
				.Index(t => t.SettingId);

			CreateTable(
			            "dbo.AdminCenters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
				                 Code = c.String(maxLength: 20),
				                 ZoneId = c.Int(false),
				                 EstablishDate = c.DateTime(false),
				                 Bosshead = c.String(maxLength: 20),
				                 BossheadIdCard = c.String(maxLength: 20),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
				                 UserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.MarketZones", t => t.ZoneId, true)
				.Index(t => t.ZoneId);

			CreateTable(
			            "dbo.MemberCenters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
				                 Code = c.String(maxLength: 20),
				                 Bosshead = c.String(maxLength: 20),
				                 BossheadIdCard = c.String(maxLength: 20),
				                 AdminCenterId = c.Int(),
				                 EstablishDate = c.DateTime(false),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
				                 UserId = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.AdminCenters", t => t.AdminCenterId)
				.Index(t => t.AdminCenterId);

			CreateTable(
			            "dbo.Customers",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Code = c.String(maxLength: 20),
				                 FullName = c.String(maxLength: 20),
				                 EnglishName = c.String(maxLength: 20),
				                 Birthday = c.DateTime(false),
				                 Gender = c.Int(false),
				                 Profession = c.String(maxLength: 20),
				                 Education = c.String(maxLength: 20),
				                 Address = c.String(maxLength: 100),
				                 PostalCode = c.String(maxLength: 20),
				                 Fax = c.String(maxLength: 20),
				                 IdCard = c.String(maxLength: 20),
				                 CardType = c.Int(false),
				                 Tel = c.String(maxLength: 20),
				                 Mobile = c.String(maxLength: 20),
				                 Email = c.String(maxLength: 20),
				                 Interest = c.String(maxLength: 100),
				                 MaritalStatus = c.Int(false),
				                 RevenueLevel = c.Int(false),
				                 ReceiveNews = c.Boolean(false),
				                 IsVip = c.Boolean(false),
				                 Remark = c.String(maxLength: 100),
				                 CreateUserId = c.String(maxLength: 20),
				                 CreateTime = c.DateTime(false),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
				                 UserId = c.String(maxLength: 20),
				                 AdminCenterId = c.Int(),
				                 MemberCenterId = c.Int(),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.AdminCenters", t => t.AdminCenterId)
				.ForeignKey("dbo.MemberCenters", t => t.MemberCenterId)
				.Index(t => t.AdminCenterId)
				.Index(t => t.MemberCenterId);

			CreateTable(
			            "dbo.HumanBodySystems",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.HealthConditions",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
				                 SystemId = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.HumanBodySystems", t => t.SystemId, true)
				.Index(t => t.SystemId);

			CreateTable(
			            "dbo.CustomerHealthArchiveMasters",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 CustomerId = c.Int(false),
				                 CustomerCode = c.String(maxLength: 20),
				                 CustomerFullName = c.String(maxLength: 20),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(maxLength: 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(maxLength: 20),
				                 Height = c.Double(false),
				                 Weight = c.Double(false),
				                 BodilyForm = c.Int(false),
				                 Hypersusceptibility = c.String(maxLength: 500),
				                 Disease = c.String(maxLength: 500),
				                 Operation = c.String(maxLength: 500),
				                 Heredopathia = c.String(maxLength: 500),
				                 HumanBodySystem = c.String(maxLength: 500),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Customers", t => t.CustomerId, true)
				.Index(t => t.CustomerId);

			CreateTable(
			            "dbo.ExpertDiagnosisRecords",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 Region = c.String(maxLength: 20),
				                 Pictures = c.String(maxLength: 500),
				                 Reason = c.String(maxLength: 500),
				                 Suggestion = c.String(maxLength: 500),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.CustomerHealthArchiveMasters", t => t.MasterId, true)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.TreatmentPlans",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 MaterialDate = c.DateTime(false),
				                 Region = c.String(maxLength: 20),
				                 ArrangedProducts = c.String(maxLength: 500),
				                 ExpectedEffect = c.String(maxLength: 500),
				                 Announcements = c.String(maxLength: 500),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.CustomerHealthArchiveMasters", t => t.MasterId, true)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.CustomerHealthManageRecords",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 DateTime = c.DateTime(false),
				                 Region = c.String(maxLength: 20),
				                 TestingProgram = c.String(maxLength: 500),
				                 Remark = c.String(maxLength: 500),
				                 Expert = c.String(maxLength: 20),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.CustomerHealthArchiveMasters", t => t.MasterId, true)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.ReturnVisitRecords",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 MasterId = c.Int(false),
				                 VisitDate = c.DateTime(false),
				                 CustomerSituation = c.String(maxLength: 500),
				                 Remark = c.String(maxLength: 500),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.CustomerHealthArchiveMasters", t => t.MasterId, true)
				.Index(t => t.MasterId);

			CreateTable(
			            "dbo.ConsumeItems",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Domain = c.String(false, 20),
				                 Group = c.String(false, 20),
				                 ItemName = c.String(false, 20),
				                 MarketPrice = c.Decimal(false, 18, 2),
				                 VipPrice = c.Decimal(false, 18, 2),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.ConsumeRecords",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 CustomerId = c.Int(false),
				                 ConsumeItemId = c.Int(false),
				                 ActualPrice = c.Decimal(false, 18, 2),
				                 CreateUserId = c.String(false, 20),
				                 CreateTime = c.DateTime(false),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(false, 20),
				                 Remark = c.String(maxLength: 200),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.ConsumeItems", t => t.ConsumeItemId, true)
				.ForeignKey("dbo.Customers", t => t.CustomerId, true)
				.Index(t => t.ConsumeItemId)
				.Index(t => t.CustomerId);

			CreateTable(
			            "dbo.Channels",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Name = c.String(maxLength: 20),
				                 Remark = c.String(maxLength: 200),
			                 })
				.PrimaryKey(t => t.Id);

			CreateTable(
			            "dbo.Articles",
			            c => new
			                 {
				                 Id = c.Int(false, true),
				                 Title = c.String(false, 50),
				                 Summary = c.String(false, 200),
				                 Content = c.String(false, storeType: "ntext"),
				                 CreateTime = c.DateTime(false),
				                 CreateUserId = c.String(false, 20),
				                 EditTime = c.DateTime(false),
				                 EditUserId = c.String(false, 20),
				                 ChannelId = c.Int(false),
				                 Status = c.Int(false),
			                 })
				.PrimaryKey(t => t.Id)
				.ForeignKey("dbo.Channels", t => t.ChannelId, true)
				.Index(t => t.ChannelId);

			CreateTable(
			            "dbo.RoleAccounts",
			            c => new
			                 {
				                 Role_RoleId = c.Int(false),
				                 Account_Id = c.Int(false),
			                 })
				.PrimaryKey(t => new {t.Role_RoleId, t.Account_Id})
				.ForeignKey("dbo.Roles", t => t.Role_RoleId, true)
				.ForeignKey("dbo.Accounts", t => t.Account_Id, true)
				.Index(t => t.Role_RoleId)
				.Index(t => t.Account_Id);
		}

		public override void Down()
		{
			DropIndex("dbo.RoleAccounts", new[] {"Account_Id"});
			DropIndex("dbo.RoleAccounts", new[] {"Role_RoleId"});
			DropIndex("dbo.Articles", new[] {"ChannelId"});
			DropIndex("dbo.ConsumeRecords", new[] {"CustomerId"});
			DropIndex("dbo.ConsumeRecords", new[] {"ConsumeItemId"});
			DropIndex("dbo.ReturnVisitRecords", new[] {"MasterId"});
			DropIndex("dbo.CustomerHealthManageRecords", new[] {"MasterId"});
			DropIndex("dbo.TreatmentPlans", new[] {"MasterId"});
			DropIndex("dbo.ExpertDiagnosisRecords", new[] {"MasterId"});
			DropIndex("dbo.CustomerHealthArchiveMasters", new[] {"CustomerId"});
			DropIndex("dbo.HealthConditions", new[] {"SystemId"});
			DropIndex("dbo.Customers", new[] {"MemberCenterId"});
			DropIndex("dbo.Customers", new[] {"AdminCenterId"});
			DropIndex("dbo.MemberCenters", new[] {"AdminCenterId"});
			DropIndex("dbo.AdminCenters", new[] {"ZoneId"});
			DropIndex("dbo.StaffSalaryDetails", new[] {"SettingId"});
			DropIndex("dbo.StaffSalaryDetails", new[] {"MasterId"});
			DropIndex("dbo.StaffSalarySummaries", new[] {"MasterId"});
			DropIndex("dbo.StaffSalarySummaries", new[] {"StaffId"});
			DropIndex("dbo.PayeeRecords", new[] {"FinanceAccountId"});
			DropIndex("dbo.PayeeRecords", new[] {"ProjectId"});
			DropIndex("dbo.PayeeRecords", new[] {"VerifyId"});
			DropIndex("dbo.PerformanceDetails", new[] {"MasterId"});
			DropIndex("dbo.PerformanceDetails", new[] {"StaffId"});
			DropIndex("dbo.StaffAchievementGatherDetails", new[] {"MasterId"});
			DropIndex("dbo.StaffAchievementGatherDetails", new[] {"StaffId"});
			DropIndex("dbo.AttendanceDetails", new[] {"MasterId"});
			DropIndex("dbo.AttendanceDetails", new[] {"StaffId"});
			DropIndex("dbo.StaffSalarySetDetails", new[] {"PartId"});
			DropIndex("dbo.StaffSalarySetDetails", new[] {"MasterId"});
			DropIndex("dbo.StaffSalarySetMasters", new[] {"StaffId"});
			DropIndex("dbo.Staffs", new[] {"PositionId"});
			DropIndex("dbo.Staffs", new[] {"DepartmentId"});
			DropForeignKey("dbo.RoleAccounts", "Account_Id", "dbo.Accounts");
			DropForeignKey("dbo.RoleAccounts", "Role_RoleId", "dbo.Roles");
			DropForeignKey("dbo.Articles", "ChannelId", "dbo.Channels");
			DropForeignKey("dbo.ConsumeRecords", "CustomerId", "dbo.Customers");
			DropForeignKey("dbo.ConsumeRecords", "ConsumeItemId", "dbo.ConsumeItems");
			DropForeignKey("dbo.ReturnVisitRecords", "MasterId", "dbo.CustomerHealthArchiveMasters");
			DropForeignKey("dbo.CustomerHealthManageRecords", "MasterId", "dbo.CustomerHealthArchiveMasters");
			DropForeignKey("dbo.TreatmentPlans", "MasterId", "dbo.CustomerHealthArchiveMasters");
			DropForeignKey("dbo.ExpertDiagnosisRecords", "MasterId", "dbo.CustomerHealthArchiveMasters");
			DropForeignKey("dbo.CustomerHealthArchiveMasters", "CustomerId", "dbo.Customers");
			DropForeignKey("dbo.HealthConditions", "SystemId", "dbo.HumanBodySystems");
			DropForeignKey("dbo.Customers", "MemberCenterId", "dbo.MemberCenters");
			DropForeignKey("dbo.Customers", "AdminCenterId", "dbo.AdminCenters");
			DropForeignKey("dbo.MemberCenters", "AdminCenterId", "dbo.AdminCenters");
			DropForeignKey("dbo.AdminCenters", "ZoneId", "dbo.MarketZones");
			DropForeignKey("dbo.StaffSalaryDetails", "SettingId", "dbo.StaffSalarySetDetails");
			DropForeignKey("dbo.StaffSalaryDetails", "MasterId", "dbo.StaffSalaryMasters");
			DropForeignKey("dbo.StaffSalarySummaries", "MasterId", "dbo.StaffSalaryMasters");
			DropForeignKey("dbo.StaffSalarySummaries", "StaffId", "dbo.Staffs");
			DropForeignKey("dbo.PayeeRecords", "FinanceAccountId", "dbo.FinanceAccounts");
			DropForeignKey("dbo.PayeeRecords", "ProjectId", "dbo.FinanceProjects");
			DropForeignKey("dbo.PayeeRecords", "VerifyId", "dbo.PayeeVerifies");
			DropForeignKey("dbo.PerformanceDetails", "MasterId", "dbo.PerformanceMasters");
			DropForeignKey("dbo.PerformanceDetails", "StaffId", "dbo.Staffs");
			DropForeignKey("dbo.StaffAchievementGatherDetails", "MasterId", "dbo.StaffAchievementGatherMasters");
			DropForeignKey("dbo.StaffAchievementGatherDetails", "StaffId", "dbo.Staffs");
			DropForeignKey("dbo.AttendanceDetails", "MasterId", "dbo.AttendanceMasters");
			DropForeignKey("dbo.AttendanceDetails", "StaffId", "dbo.Staffs");
			DropForeignKey("dbo.StaffSalarySetDetails", "PartId", "dbo.SalaryParts");
			DropForeignKey("dbo.StaffSalarySetDetails", "MasterId", "dbo.StaffSalarySetMasters");
			DropForeignKey("dbo.StaffSalarySetMasters", "StaffId", "dbo.Staffs");
			DropForeignKey("dbo.Staffs", "PositionId", "dbo.StaffPositions");
			DropForeignKey("dbo.Staffs", "DepartmentId", "dbo.Departments");
			DropTable("dbo.RoleAccounts");
			DropTable("dbo.Articles");
			DropTable("dbo.Channels");
			DropTable("dbo.ConsumeRecords");
			DropTable("dbo.ConsumeItems");
			DropTable("dbo.ReturnVisitRecords");
			DropTable("dbo.CustomerHealthManageRecords");
			DropTable("dbo.TreatmentPlans");
			DropTable("dbo.ExpertDiagnosisRecords");
			DropTable("dbo.CustomerHealthArchiveMasters");
			DropTable("dbo.HealthConditions");
			DropTable("dbo.HumanBodySystems");
			DropTable("dbo.Customers");
			DropTable("dbo.MemberCenters");
			DropTable("dbo.AdminCenters");
			DropTable("dbo.StaffSalaryDetails");
			DropTable("dbo.StaffSalarySummaries");
			DropTable("dbo.StaffSalaryMasters");
			DropTable("dbo.CustomerCapitals");
			DropTable("dbo.PayeeVerifies");
			DropTable("dbo.PayeeRecords");
			DropTable("dbo.FinanceAccounts");
			DropTable("dbo.FinanceProjects");
			DropTable("dbo.PerformanceDetails");
			DropTable("dbo.PerformanceMasters");
			DropTable("dbo.StaffAchievementGatherDetails");
			DropTable("dbo.StaffAchievementGatherMasters");
			DropTable("dbo.MarketZones");
			DropTable("dbo.AttendanceMasters");
			DropTable("dbo.AttendanceDetails");
			DropTable("dbo.SalaryParts");
			DropTable("dbo.StaffSalarySetDetails");
			DropTable("dbo.StaffSalarySetMasters");
			DropTable("dbo.Staffs");
			DropTable("dbo.StaffPositions");
			DropTable("dbo.Departments");
			DropTable("dbo.WebObjects");
			DropTable("dbo.Roles");
			DropTable("dbo.Accounts");
		}
	}
}